﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using BaBaoFan.Modifier.Model;
using Dapper;

namespace BaBaoFan.Modifier.Data
{
    public class UserInfoRepository : IUserInfoRepository
    {
        private IDbConnection _conn;
        public UserInfoRepository(PmDbConnection conn)
        {
            _conn = conn.Connection;
        }

        public UserInfo GetUserByName(string userName)
        {
            string sql = "select id as Id,user as UserName,pass as Password,checked as IsEnable from erp_user where user=@UserName";
            return _conn.QuerySingleOrDefault<UserInfo>(sql, new { UserName = userName });
        }
    }
}
